#pragma once
#include "CyMessageFilter.h"
#include "CyDelegate.h"
#include "CyGUIText.h"
#include "CyGUIButton.h"
#include "CyGUIEditBox.h"
#include "CyNetTCPClient.h"
#include "CyTimer.h"
#include <string>

class CyButton1
{
public:
	CyButton1(HWND hWnd);
	~CyButton1(void);

private:
	BOOL HandleMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
	BOOL HandleMessage2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
	BOOL HandleMessage3(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
	void Print(std::wstring str);

	BOOL RecvHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
	BOOL CloseHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	BOOL TimerHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	BOOL SendHandler(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

private:

	std::wstring _console;
	int count, count2;
	CyGUIText * _txtX, * _txtY, * _txtZ, * _txtMag;
	CyGUIButton * _button, * _button2;
	CyGUIEditBox * _edt, * _edtConsole;
	CyNetTCPClient _client;
	CyTimer * _timer;
};